<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
if (window.internals)
  internals.settings.setEditingBehavior('win');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>|abc def</div></marquee></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>abc def|</div></marquee></div>',
  '1-0 left word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>a|bc def</div></marquee></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>|abc def</div></marquee></div>',
  '1-1 left word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>ab|c def</div></marquee></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>|abc def</div></marquee></div>',
  '1-2 left word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>abc| def</div></marquee></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>|abc def</div></marquee></div>',
  '1-3 left word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>abc |def</div></marquee></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>|abc def</div></marquee></div>',
  '1-4 left word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>abc d|ef</div></marquee></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>abc |def</div></marquee></div>',
  '1-5 left word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>abc de|f</div></marquee></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>abc |def</div></marquee></div>',
  '1-6 left word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>abc def|</div></marquee></div>',
  selection => selection.modify('move', 'left', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>abc |def</div></marquee></div>',
  '1-7 left word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>|abc def</div></marquee></div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>abc |def</div></marquee></div>',
  '1-0 right word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>a|bc def</div></marquee></div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>abc |def</div></marquee></div>',
  '1-1 right word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>ab|c def</div></marquee></div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>abc |def</div></marquee></div>',
  '1-2 right word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>abc| def</div></marquee></div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>abc |def</div></marquee></div>',
  '1-3 right word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>abc |def</div></marquee></div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>abc def|</div></marquee></div>',
  '1-4 right word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>abc d|ef</div></marquee></div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>abc def|</div></marquee></div>',
  '1-5 right word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>abc de|f</div></marquee></div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>abc def|</div></marquee></div>',
  '1-6 right word');

selection_test(
  '<div contenteditable><vkern></vkern><marquee><div>abc def|</div></marquee></div>',
  selection => selection.modify('move', 'right', 'word'),
  '<div contenteditable><vkern></vkern><marquee><div>abc def|</div></marquee></div>',
  '1-7 right word');
</script>
